package com.bckj.fastboot.iot.biz.controller;

import com.bckj.fastboot.core.lang.model.PageResult;
import com.bckj.fastboot.core.page.PageSupport;
import com.bckj.fastboot.iot.api.service.IotBasicDataRemoteService;
import com.bckj.fastboot.iot.common.dto.query.IotBasicDataQuery;
import com.bckj.fastboot.iot.common.dto.response.IotBasicDataResponse;
import com.bckj.fastboot.iot.biz.service.IotBasicDataQueryService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * IotBasicDataController
 *
 * @author wfc
 **/
@RestController
@RequestMapping("iotBasicData")
@RequiredArgsConstructor
public class IotBasicDataController implements IotBasicDataRemoteService {

    private final IotBasicDataQueryService iotBasicDataQueryService;

    @Override
    public IotBasicDataResponse details(Long id) {
        return iotBasicDataQueryService.details(id);
    }

    @Override
    public PageResult<IotBasicDataResponse> page(IotBasicDataQuery query) {
        return iotBasicDataQueryService.page(PageSupport.buildPageable(), query);
    }
}
